![]() ![]() ![]() |
EOFException
), the iterator becomes equal to the iterator
end-of-stream iterator value.
The constructor with no arguments always contructs an end of stream
iterator object which is the only legitimate iterator to be used for the
end condition.
It is impossible to store things into a InputStreamIterator.
The main peculiarity of the InputStreamIterator is the fact that the
next() method is not equality preservings, that is i.cmp(j)
does not guarantee at all that i.next(); j.next(); i.cmp(j)
.
Every time next() is used a new value is returned.
The practical consequence of this fact is that InputStreamIterators can be used only for one-pass algorithms, which actually makes perfect sense, since for multi-pass algorithms it is always more appropriate to use inmemory data structures. Two end-of-stream iterators are always equal. An end-of-stream iterator is not equal to a non-end-of-stream iterator.
![]() ![]() ![]() |